<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="样品编号" prop="redChemicalSampleCode">
        <el-input
          v-model="queryParams.redChemicalSampleCode"
          placeholder="请输入样品编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="样品名称" prop="redChemicalSampleName">
        <el-input
          v-model="queryParams.redChemicalSampleName"
          placeholder="请输入样品名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="年份" prop="redChemicalYear">
        <el-input
          v-model="queryParams.redChemicalYear"
          placeholder="请输入年份"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['composition:composition:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['composition:composition:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['composition:composition:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['composition:composition:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="compositionList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="主键ID" align="center" prop="id" />
      <el-table-column label="样品编号" align="center" prop="redChemicalSampleCode" />
      <el-table-column label="样品名称" align="center" prop="redChemicalSampleName" />
      <el-table-column label="年份" align="center" prop="redChemicalYear" />
      <el-table-column label="产地" align="center" prop="redChemicalOrigin" />
      <el-table-column label="等级" align="center" prop="redChemicalGrade" />
      <el-table-column label="类型" align="center" prop="redChemicalType" />
      <el-table-column label="形态" align="center" prop="redChemicalShape" />
      <el-table-column label="品种" align="center" prop="redChemicalVariety" />
      <el-table-column label="样品说明" align="center" prop="redChemicalSampleDesc" />
      <el-table-column label="总植物碱%" align="center" prop="redChemicalTotalAlkaloidsPct" />
      <el-table-column label="还原糖%" align="center" prop="redChemicalReducingSugarPct" />
      <el-table-column label="总糖%" align="center" prop="redChemicalTotalSugarPct" />
      <el-table-column label="总氮%" align="center" prop="redChemicalTotalNitrogenPct" />
      <el-table-column label=" 钾%" align="center" prop="redChemicalPotassiumPct" />
      <el-table-column label="氯%" align="center" prop="redChemicalChlorinePct" />
      <el-table-column label="pH" align="center" prop="redChemicalPh" />
      <el-table-column label="淀粉%" align="center" prop="redChemicalStarchPct" />
      <el-table-column label="二氯甲烷提取物%" align="center" prop="redChemicalDichloromethaneExtractPct" />
      <el-table-column label="茄尼醇" align="center" prop="redChemicalSolanesolMgG" />
      <el-table-column label="硫酸根" align="center" prop="redChemicalSulfateMgG" />
      <el-table-column label="磷酸根" align="center" prop="redChemicalPhosphateMgG" />
      <el-table-column label="镁%" align="center" prop="redChemicalMagnesiumPct" />
      <el-table-column label="钙%" align="center" prop="redChemicalCalciumPct" />
      <el-table-column label="新绿原酸" align="center" prop="redChemicalNeochlorogenicAcidMgG" />
      <el-table-column label="绿原酸" align="center" prop="redChemicalChlorogenicAcidMgG" />
      <el-table-column label="隐绿原酸" align="center" prop="redChemicalCryptochlorogenicAcidMgG" />
      <el-table-column label="莨菪亭" align="center" prop="redChemicalScopoletinMgG" />
      <el-table-column label="芸香苷" align="center" prop="redChemicalRutinMgG" />
      <el-table-column label="乙二酸" align="center" prop="redChemicalOxalicAcidMgG" />
      <el-table-column label="丙二酸" align="center" prop="redChemicalMalonicAcidMgG" />
      <el-table-column label="丁二酸" align="center" prop="redChemicalSuccinicAcidMgG" />
      <el-table-column label="苹果酸" align="center" prop="redChemicalMalicAcidMgG" />
      <el-table-column label="柠檬酸" align="center" prop="redChemicalCitricAcidMgG" />
      <el-table-column label="香草酸" align="center" prop="redChemicalVanillicAcidMgG" />
      <el-table-column label="十四酸" align="center" prop="redChemicalMyristicAcidMgG" />
      <el-table-column label="十六酸" align="center" prop="redChemicalPalmiticAcidMgG" />
      <el-table-column label="亚油酸" align="center" prop="redChemicalLinoleicAcidMgG" />
      <el-table-column label="油酸+亚麻酸" align="center" prop="redChemicalOleicLinolenicAcidMgG" />
      <el-table-column label="十八酸" align="center" prop="redChemicalStearicAcidMgG" />
      <el-table-column label="二十酸" align="center" prop="redChemicalArachidicAcidMgG" />
      <el-table-column label="天冬氨酸" align="center" prop="redChemicalAsparticAcidUgG" />
      <el-table-column label="苏氨酸" align="center" prop="redChemicalThreonineUgG" />
      <el-table-column label="丝氨酸" align="center" prop="redChemicalSerineUgG" />
      <el-table-column label="天冬酰胺" align="center" prop="redChemicalAsparagineUgG" />
      <el-table-column label="谷氨酸" align="center" prop="redChemicalGlutamicAcidUgG" />
      <el-table-column label="谷酰胺" align="center" prop="redChemicalGlutamineUgG" />
      <el-table-column label="甘氨酸" align="center" prop="redChemicalGlycineUgG" />
      <el-table-column label="丙氨酸" align="center" prop="redChemicalAlanineUgG" />
      <el-table-column label="缬氨酸" align="center" prop="redChemicalValineUgG" />
      <el-table-column label="胱氨酸" align="center" prop="redChemicalCystineUgG" />
      <el-table-column label="蛋氨酸" align="center" prop="redChemicalMethionineUgG" />
      <el-table-column label="异亮氨酸" align="center" prop="redChemicalIsoleucineUgG" />
      <el-table-column label="亮氨酸" align="center" prop="redChemicalLeucineUgG" />
      <el-table-column label="酪氨酸" align="center" prop="redChemicalTyrosineUgG" />
      <el-table-column label="苯丙氨酸" align="center" prop="redChemicalPhenylalanineUgG" />
      <el-table-column label="4-氨基丁酸" align="center" prop="redChemicalGabaUgG" />
      <el-table-column label="赖氨酸" align="center" prop="redChemicalLysineUgG" />
      <el-table-column label="组氨酸" align="center" prop="redChemicalHistidineUgG" />
      <el-table-column label="色氨酸" align="center" prop="redChemicalTryptophanUgG" />
      <el-table-column label="精氨酸" align="center" prop="redChemicalArginineUgG" />
      <el-table-column label="脯氨酸" align="center" prop="redChemicalProlineUgG" />
      <el-table-column label="葡萄糖胺" align="center" prop="redChemicalGlucosamineUgG" />
      <el-table-column label="1-脱氧-1-L-氨基丁酸-D-果糖" align="center" prop="redChemicalFruAmbUgG" />
      <el-table-column label="1-脱氧-1-L-组氨酸-D-果糖" align="center" prop="redChemicalFruHisUgG" />
      <el-table-column label="1-脱氧-1-L-脯氨酸-D-果糖" align="center" prop="redChemicalFruProUgG" />
      <el-table-column label="1-脱氧-1-L-缬氨酸-D-果糖" align="center" prop="redChemicalFruValUgG" />
      <el-table-column label="1-脱氧-1-L-苏氨酸-D-果糖" align="center" prop="redChemicalFruThrUgG" />
      <el-table-column label="1-脱氧-1-L-甘氨酸-D-果糖" align="center" prop="redChemicalFruGlyUgG" />
      <el-table-column label="1-脱氧-1-L-丙氨酸-D-果糖" align="center" prop="redChemicalFruAlaUgG" />
      <el-table-column label="1-脱氧-1-L-天冬酰胺-D-果糖" align="center" prop="redChemicalFruAsnUgG" />
      <el-table-column label="1-脱氧-1-L-天冬氨酸-D-果糖" align="center" prop="redChemicalFruAspUgG" />
      <el-table-column label="1-脱氧-1-L-谷氨酰胺-D-果糖" align="center" prop="redChemicalFruGlnUgG" />
      <el-table-column label="1-脱氧-1-L-谷氨酸-D-果糖" align="center" prop="redChemicalFruGluUgG" />
      <el-table-column label="1-脱氧-1-L-异亮氨酸-D-果糖" align="center" prop="redChemicalFruIleUgG" />
      <el-table-column label="1-脱氧-1-L-亮氨酸-D-果糖" align="center" prop="redChemicalFruLeuUgG" />
      <el-table-column label="1-脱氧-1-L-酪氨酸-D-果糖" align="center" prop="redChemicalFruTyrUgG" />
      <el-table-column label="1-脱氧-1-L-苯丙氨酸-D-果糖" align="center" prop="redChemicalFruPheUgG" />
      <el-table-column label="l-脱氧-1-L-色氨酸-D-果糖" align="center" prop="redChemicalFruTrpUgG" />
      <el-table-column label="新植二烯mg/g" align="center" prop="redChemicalNeophytadieneMgG" />
      <el-table-column label="创建者" align="center" prop="createBy" />
      <el-table-column label="更新者" align="center" prop="updateBy" />
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['composition:composition:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['composition:composition:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改初烤烟近红外化学成分检测对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="样品编号" prop="redChemicalSampleCode">
          <el-input v-model="form.redChemicalSampleCode" placeholder="请输入样品编号" />
        </el-form-item>
        <el-form-item label="样品名称" prop="redChemicalSampleName">
          <el-input v-model="form.redChemicalSampleName" placeholder="请输入样品名称" />
        </el-form-item>
        <el-form-item label="年份" prop="redChemicalYear">
          <el-input v-model="form.redChemicalYear" placeholder="请输入年份" />
        </el-form-item>
        <el-form-item label="产地" prop="redChemicalOrigin">
          <el-input v-model="form.redChemicalOrigin" placeholder="请输入产地" />
        </el-form-item>
        <el-form-item label="等级" prop="redChemicalGrade">
          <el-input v-model="form.redChemicalGrade" placeholder="请输入等级" />
        </el-form-item>
        <el-form-item label="形态" prop="redChemicalShape">
          <el-input v-model="form.redChemicalShape" placeholder="请输入形态" />
        </el-form-item>
        <el-form-item label="品种" prop="redChemicalVariety">
          <el-input v-model="form.redChemicalVariety" placeholder="请输入品种" />
        </el-form-item>
        <el-form-item label="样品说明" prop="redChemicalSampleDesc">
          <el-input v-model="form.redChemicalSampleDesc" placeholder="请输入样品说明" />
        </el-form-item>
        <el-form-item label="总植物碱%" prop="redChemicalTotalAlkaloidsPct">
          <el-input v-model="form.redChemicalTotalAlkaloidsPct" placeholder="请输入总植物碱%" />
        </el-form-item>
        <el-form-item label="还原糖%" prop="redChemicalReducingSugarPct">
          <el-input v-model="form.redChemicalReducingSugarPct" placeholder="请输入还原糖%" />
        </el-form-item>
        <el-form-item label="总糖%" prop="redChemicalTotalSugarPct">
          <el-input v-model="form.redChemicalTotalSugarPct" placeholder="请输入总糖%" />
        </el-form-item>
        <el-form-item label="总氮%" prop="redChemicalTotalNitrogenPct">
          <el-input v-model="form.redChemicalTotalNitrogenPct" placeholder="请输入总氮%" />
        </el-form-item>
        <el-form-item label=" 钾%" prop="redChemicalPotassiumPct">
          <el-input v-model="form.redChemicalPotassiumPct" placeholder="请输入 钾%" />
        </el-form-item>
        <el-form-item label="氯%" prop="redChemicalChlorinePct">
          <el-input v-model="form.redChemicalChlorinePct" placeholder="请输入氯%" />
        </el-form-item>
        <el-form-item label="pH" prop="redChemicalPh">
          <el-input v-model="form.redChemicalPh" placeholder="请输入pH" />
        </el-form-item>
        <el-form-item label="淀粉%" prop="redChemicalStarchPct">
          <el-input v-model="form.redChemicalStarchPct" placeholder="请输入淀粉%" />
        </el-form-item>
        <el-form-item label="二氯甲烷提取物%" prop="redChemicalDichloromethaneExtractPct">
          <el-input v-model="form.redChemicalDichloromethaneExtractPct" placeholder="请输入二氯甲烷提取物%" />
        </el-form-item>
        <el-form-item label="茄尼醇" prop="redChemicalSolanesolMgG">
          <el-input v-model="form.redChemicalSolanesolMgG" placeholder="请输入茄尼醇" />
        </el-form-item>
        <el-form-item label="硫酸根" prop="redChemicalSulfateMgG">
          <el-input v-model="form.redChemicalSulfateMgG" placeholder="请输入硫酸根" />
        </el-form-item>
        <el-form-item label="磷酸根" prop="redChemicalPhosphateMgG">
          <el-input v-model="form.redChemicalPhosphateMgG" placeholder="请输入磷酸根" />
        </el-form-item>
        <el-form-item label="镁%" prop="redChemicalMagnesiumPct">
          <el-input v-model="form.redChemicalMagnesiumPct" placeholder="请输入镁%" />
        </el-form-item>
        <el-form-item label="钙%" prop="redChemicalCalciumPct">
          <el-input v-model="form.redChemicalCalciumPct" placeholder="请输入钙%" />
        </el-form-item>
        <el-form-item label="新绿原酸" prop="redChemicalNeochlorogenicAcidMgG">
          <el-input v-model="form.redChemicalNeochlorogenicAcidMgG" placeholder="请输入新绿原酸" />
        </el-form-item>
        <el-form-item label="绿原酸" prop="redChemicalChlorogenicAcidMgG">
          <el-input v-model="form.redChemicalChlorogenicAcidMgG" placeholder="请输入绿原酸" />
        </el-form-item>
        <el-form-item label="隐绿原酸" prop="redChemicalCryptochlorogenicAcidMgG">
          <el-input v-model="form.redChemicalCryptochlorogenicAcidMgG" placeholder="请输入隐绿原酸" />
        </el-form-item>
        <el-form-item label="莨菪亭" prop="redChemicalScopoletinMgG">
          <el-input v-model="form.redChemicalScopoletinMgG" placeholder="请输入莨菪亭" />
        </el-form-item>
        <el-form-item label="芸香苷" prop="redChemicalRutinMgG">
          <el-input v-model="form.redChemicalRutinMgG" placeholder="请输入芸香苷" />
        </el-form-item>
        <el-form-item label="乙二酸" prop="redChemicalOxalicAcidMgG">
          <el-input v-model="form.redChemicalOxalicAcidMgG" placeholder="请输入乙二酸" />
        </el-form-item>
        <el-form-item label="丙二酸" prop="redChemicalMalonicAcidMgG">
          <el-input v-model="form.redChemicalMalonicAcidMgG" placeholder="请输入丙二酸" />
        </el-form-item>
        <el-form-item label="丁二酸" prop="redChemicalSuccinicAcidMgG">
          <el-input v-model="form.redChemicalSuccinicAcidMgG" placeholder="请输入丁二酸" />
        </el-form-item>
        <el-form-item label="苹果酸" prop="redChemicalMalicAcidMgG">
          <el-input v-model="form.redChemicalMalicAcidMgG" placeholder="请输入苹果酸" />
        </el-form-item>
        <el-form-item label="柠檬酸" prop="redChemicalCitricAcidMgG">
          <el-input v-model="form.redChemicalCitricAcidMgG" placeholder="请输入柠檬酸" />
        </el-form-item>
        <el-form-item label="香草酸" prop="redChemicalVanillicAcidMgG">
          <el-input v-model="form.redChemicalVanillicAcidMgG" placeholder="请输入香草酸" />
        </el-form-item>
        <el-form-item label="十四酸" prop="redChemicalMyristicAcidMgG">
          <el-input v-model="form.redChemicalMyristicAcidMgG" placeholder="请输入十四酸" />
        </el-form-item>
        <el-form-item label="十六酸" prop="redChemicalPalmiticAcidMgG">
          <el-input v-model="form.redChemicalPalmiticAcidMgG" placeholder="请输入十六酸" />
        </el-form-item>
        <el-form-item label="亚油酸" prop="redChemicalLinoleicAcidMgG">
          <el-input v-model="form.redChemicalLinoleicAcidMgG" placeholder="请输入亚油酸" />
        </el-form-item>
        <el-form-item label="油酸+亚麻酸" prop="redChemicalOleicLinolenicAcidMgG">
          <el-input v-model="form.redChemicalOleicLinolenicAcidMgG" placeholder="请输入油酸+亚麻酸" />
        </el-form-item>
        <el-form-item label="十八酸" prop="redChemicalStearicAcidMgG">
          <el-input v-model="form.redChemicalStearicAcidMgG" placeholder="请输入十八酸" />
        </el-form-item>
        <el-form-item label="二十酸" prop="redChemicalArachidicAcidMgG">
          <el-input v-model="form.redChemicalArachidicAcidMgG" placeholder="请输入二十酸" />
        </el-form-item>
        <el-form-item label="天冬氨酸" prop="redChemicalAsparticAcidUgG">
          <el-input v-model="form.redChemicalAsparticAcidUgG" placeholder="请输入天冬氨酸" />
        </el-form-item>
        <el-form-item label="苏氨酸" prop="redChemicalThreonineUgG">
          <el-input v-model="form.redChemicalThreonineUgG" placeholder="请输入苏氨酸" />
        </el-form-item>
        <el-form-item label="丝氨酸" prop="redChemicalSerineUgG">
          <el-input v-model="form.redChemicalSerineUgG" placeholder="请输入丝氨酸" />
        </el-form-item>
        <el-form-item label="天冬酰胺" prop="redChemicalAsparagineUgG">
          <el-input v-model="form.redChemicalAsparagineUgG" placeholder="请输入天冬酰胺" />
        </el-form-item>
        <el-form-item label="谷氨酸" prop="redChemicalGlutamicAcidUgG">
          <el-input v-model="form.redChemicalGlutamicAcidUgG" placeholder="请输入谷氨酸" />
        </el-form-item>
        <el-form-item label="谷酰胺" prop="redChemicalGlutamineUgG">
          <el-input v-model="form.redChemicalGlutamineUgG" placeholder="请输入谷酰胺" />
        </el-form-item>
        <el-form-item label="甘氨酸" prop="redChemicalGlycineUgG">
          <el-input v-model="form.redChemicalGlycineUgG" placeholder="请输入甘氨酸" />
        </el-form-item>
        <el-form-item label="丙氨酸" prop="redChemicalAlanineUgG">
          <el-input v-model="form.redChemicalAlanineUgG" placeholder="请输入丙氨酸" />
        </el-form-item>
        <el-form-item label="缬氨酸" prop="redChemicalValineUgG">
          <el-input v-model="form.redChemicalValineUgG" placeholder="请输入缬氨酸" />
        </el-form-item>
        <el-form-item label="胱氨酸" prop="redChemicalCystineUgG">
          <el-input v-model="form.redChemicalCystineUgG" placeholder="请输入胱氨酸" />
        </el-form-item>
        <el-form-item label="蛋氨酸" prop="redChemicalMethionineUgG">
          <el-input v-model="form.redChemicalMethionineUgG" placeholder="请输入蛋氨酸" />
        </el-form-item>
        <el-form-item label="异亮氨酸" prop="redChemicalIsoleucineUgG">
          <el-input v-model="form.redChemicalIsoleucineUgG" placeholder="请输入异亮氨酸" />
        </el-form-item>
        <el-form-item label="亮氨酸" prop="redChemicalLeucineUgG">
          <el-input v-model="form.redChemicalLeucineUgG" placeholder="请输入亮氨酸" />
        </el-form-item>
        <el-form-item label="酪氨酸" prop="redChemicalTyrosineUgG">
          <el-input v-model="form.redChemicalTyrosineUgG" placeholder="请输入酪氨酸" />
        </el-form-item>
        <el-form-item label="苯丙氨酸" prop="redChemicalPhenylalanineUgG">
          <el-input v-model="form.redChemicalPhenylalanineUgG" placeholder="请输入苯丙氨酸" />
        </el-form-item>
        <el-form-item label="4-氨基丁酸" prop="redChemicalGabaUgG">
          <el-input v-model="form.redChemicalGabaUgG" placeholder="请输入4-氨基丁酸" />
        </el-form-item>
        <el-form-item label="赖氨酸" prop="redChemicalLysineUgG">
          <el-input v-model="form.redChemicalLysineUgG" placeholder="请输入赖氨酸" />
        </el-form-item>
        <el-form-item label="组氨酸" prop="redChemicalHistidineUgG">
          <el-input v-model="form.redChemicalHistidineUgG" placeholder="请输入组氨酸" />
        </el-form-item>
        <el-form-item label="色氨酸" prop="redChemicalTryptophanUgG">
          <el-input v-model="form.redChemicalTryptophanUgG" placeholder="请输入色氨酸" />
        </el-form-item>
        <el-form-item label="精氨酸" prop="redChemicalArginineUgG">
          <el-input v-model="form.redChemicalArginineUgG" placeholder="请输入精氨酸" />
        </el-form-item>
        <el-form-item label="脯氨酸" prop="redChemicalProlineUgG">
          <el-input v-model="form.redChemicalProlineUgG" placeholder="请输入脯氨酸" />
        </el-form-item>
        <el-form-item label="葡萄糖胺" prop="redChemicalGlucosamineUgG">
          <el-input v-model="form.redChemicalGlucosamineUgG" placeholder="请输入葡萄糖胺" />
        </el-form-item>
        <el-form-item label="1-脱氧-1-L-氨基丁酸-D-果糖" prop="redChemicalFruAmbUgG">
          <el-input v-model="form.redChemicalFruAmbUgG" placeholder="请输入1-脱氧-1-L-氨基丁酸-D-果糖" />
        </el-form-item>
        <el-form-item label="1-脱氧-1-L-组氨酸-D-果糖" prop="redChemicalFruHisUgG">
          <el-input v-model="form.redChemicalFruHisUgG" placeholder="请输入1-脱氧-1-L-组氨酸-D-果糖" />
        </el-form-item>
        <el-form-item label="1-脱氧-1-L-脯氨酸-D-果糖" prop="redChemicalFruProUgG">
          <el-input v-model="form.redChemicalFruProUgG" placeholder="请输入1-脱氧-1-L-脯氨酸-D-果糖" />
        </el-form-item>
        <el-form-item label="1-脱氧-1-L-缬氨酸-D-果糖" prop="redChemicalFruValUgG">
          <el-input v-model="form.redChemicalFruValUgG" placeholder="请输入1-脱氧-1-L-缬氨酸-D-果糖" />
        </el-form-item>
        <el-form-item label="1-脱氧-1-L-苏氨酸-D-果糖" prop="redChemicalFruThrUgG">
          <el-input v-model="form.redChemicalFruThrUgG" placeholder="请输入1-脱氧-1-L-苏氨酸-D-果糖" />
        </el-form-item>
        <el-form-item label="1-脱氧-1-L-甘氨酸-D-果糖" prop="redChemicalFruGlyUgG">
          <el-input v-model="form.redChemicalFruGlyUgG" placeholder="请输入1-脱氧-1-L-甘氨酸-D-果糖" />
        </el-form-item>
        <el-form-item label="1-脱氧-1-L-丙氨酸-D-果糖" prop="redChemicalFruAlaUgG">
          <el-input v-model="form.redChemicalFruAlaUgG" placeholder="请输入1-脱氧-1-L-丙氨酸-D-果糖" />
        </el-form-item>
        <el-form-item label="1-脱氧-1-L-天冬酰胺-D-果糖" prop="redChemicalFruAsnUgG">
          <el-input v-model="form.redChemicalFruAsnUgG" placeholder="请输入1-脱氧-1-L-天冬酰胺-D-果糖" />
        </el-form-item>
        <el-form-item label="1-脱氧-1-L-天冬氨酸-D-果糖" prop="redChemicalFruAspUgG">
          <el-input v-model="form.redChemicalFruAspUgG" placeholder="请输入1-脱氧-1-L-天冬氨酸-D-果糖" />
        </el-form-item>
        <el-form-item label="1-脱氧-1-L-谷氨酰胺-D-果糖" prop="redChemicalFruGlnUgG">
          <el-input v-model="form.redChemicalFruGlnUgG" placeholder="请输入1-脱氧-1-L-谷氨酰胺-D-果糖" />
        </el-form-item>
        <el-form-item label="1-脱氧-1-L-谷氨酸-D-果糖" prop="redChemicalFruGluUgG">
          <el-input v-model="form.redChemicalFruGluUgG" placeholder="请输入1-脱氧-1-L-谷氨酸-D-果糖" />
        </el-form-item>
        <el-form-item label="1-脱氧-1-L-异亮氨酸-D-果糖" prop="redChemicalFruIleUgG">
          <el-input v-model="form.redChemicalFruIleUgG" placeholder="请输入1-脱氧-1-L-异亮氨酸-D-果糖" />
        </el-form-item>
        <el-form-item label="1-脱氧-1-L-亮氨酸-D-果糖" prop="redChemicalFruLeuUgG">
          <el-input v-model="form.redChemicalFruLeuUgG" placeholder="请输入1-脱氧-1-L-亮氨酸-D-果糖" />
        </el-form-item>
        <el-form-item label="1-脱氧-1-L-酪氨酸-D-果糖" prop="redChemicalFruTyrUgG">
          <el-input v-model="form.redChemicalFruTyrUgG" placeholder="请输入1-脱氧-1-L-酪氨酸-D-果糖" />
        </el-form-item>
        <el-form-item label="1-脱氧-1-L-苯丙氨酸-D-果糖" prop="redChemicalFruPheUgG">
          <el-input v-model="form.redChemicalFruPheUgG" placeholder="请输入1-脱氧-1-L-苯丙氨酸-D-果糖" />
        </el-form-item>
        <el-form-item label="l-脱氧-1-L-色氨酸-D-果糖" prop="redChemicalFruTrpUgG">
          <el-input v-model="form.redChemicalFruTrpUgG" placeholder="请输入l-脱氧-1-L-色氨酸-D-果糖" />
        </el-form-item>
        <el-form-item label="新植二烯mg/g" prop="redChemicalNeophytadieneMgG">
          <el-input v-model="form.redChemicalNeophytadieneMgG" placeholder="请输入新植二烯mg/g" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listComposition, getComposition, delComposition, addComposition, updateComposition } from "@/api/composition/composition";

export default {
  name: "Composition",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 初烤烟近红外化学成分检测表格数据
      compositionList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        redChemicalSampleCode: null,
        redChemicalSampleName: null,
        redChemicalYear: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        redChemicalSampleCode: [
          { required: true, message: "样品编号不能为空", trigger: "blur" }
        ],
        redChemicalSampleName: [
          { required: true, message: "样品名称不能为空", trigger: "blur" }
        ],
        redChemicalYear: [
          { required: true, message: "年份不能为空", trigger: "blur" }
        ],
        redChemicalOrigin: [
          { required: true, message: "产地不能为空", trigger: "blur" }
        ],
        redChemicalGrade: [
          { required: true, message: "等级不能为空", trigger: "blur" }
        ],
        redChemicalType: [
          { required: true, message: "类型不能为空", trigger: "change" }
        ],
        redChemicalShape: [
          { required: true, message: "形态不能为空", trigger: "blur" }
        ],
        redChemicalVariety: [
          { required: true, message: "品种不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询初烤烟近红外化学成分检测列表 */
    getList() {
      this.loading = true;
      listComposition(this.queryParams).then(response => {
        this.compositionList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        redChemicalSampleCode: null,
        redChemicalSampleName: null,
        redChemicalYear: null,
        redChemicalOrigin: null,
        redChemicalGrade: null,
        redChemicalType: null,
        redChemicalShape: null,
        redChemicalVariety: null,
        redChemicalSampleDesc: null,
        redChemicalTotalAlkaloidsPct: null,
        redChemicalReducingSugarPct: null,
        redChemicalTotalSugarPct: null,
        redChemicalTotalNitrogenPct: null,
        redChemicalPotassiumPct: null,
        redChemicalChlorinePct: null,
        redChemicalPh: null,
        redChemicalStarchPct: null,
        redChemicalDichloromethaneExtractPct: null,
        redChemicalSolanesolMgG: null,
        redChemicalSulfateMgG: null,
        redChemicalPhosphateMgG: null,
        redChemicalMagnesiumPct: null,
        redChemicalCalciumPct: null,
        redChemicalNeochlorogenicAcidMgG: null,
        redChemicalChlorogenicAcidMgG: null,
        redChemicalCryptochlorogenicAcidMgG: null,
        redChemicalScopoletinMgG: null,
        redChemicalRutinMgG: null,
        redChemicalOxalicAcidMgG: null,
        redChemicalMalonicAcidMgG: null,
        redChemicalSuccinicAcidMgG: null,
        redChemicalMalicAcidMgG: null,
        redChemicalCitricAcidMgG: null,
        redChemicalVanillicAcidMgG: null,
        redChemicalMyristicAcidMgG: null,
        redChemicalPalmiticAcidMgG: null,
        redChemicalLinoleicAcidMgG: null,
        redChemicalOleicLinolenicAcidMgG: null,
        redChemicalStearicAcidMgG: null,
        redChemicalArachidicAcidMgG: null,
        redChemicalAsparticAcidUgG: null,
        redChemicalThreonineUgG: null,
        redChemicalSerineUgG: null,
        redChemicalAsparagineUgG: null,
        redChemicalGlutamicAcidUgG: null,
        redChemicalGlutamineUgG: null,
        redChemicalGlycineUgG: null,
        redChemicalAlanineUgG: null,
        redChemicalValineUgG: null,
        redChemicalCystineUgG: null,
        redChemicalMethionineUgG: null,
        redChemicalIsoleucineUgG: null,
        redChemicalLeucineUgG: null,
        redChemicalTyrosineUgG: null,
        redChemicalPhenylalanineUgG: null,
        redChemicalGabaUgG: null,
        redChemicalLysineUgG: null,
        redChemicalHistidineUgG: null,
        redChemicalTryptophanUgG: null,
        redChemicalArginineUgG: null,
        redChemicalProlineUgG: null,
        redChemicalGlucosamineUgG: null,
        redChemicalFruAmbUgG: null,
        redChemicalFruHisUgG: null,
        redChemicalFruProUgG: null,
        redChemicalFruValUgG: null,
        redChemicalFruThrUgG: null,
        redChemicalFruGlyUgG: null,
        redChemicalFruAlaUgG: null,
        redChemicalFruAsnUgG: null,
        redChemicalFruAspUgG: null,
        redChemicalFruGlnUgG: null,
        redChemicalFruGluUgG: null,
        redChemicalFruIleUgG: null,
        redChemicalFruLeuUgG: null,
        redChemicalFruTyrUgG: null,
        redChemicalFruPheUgG: null,
        redChemicalFruTrpUgG: null,
        redChemicalNeophytadieneMgG: null,
        status: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加初烤烟近红外化学成分检测";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getComposition(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改初烤烟近红外化学成分检测";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateComposition(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addComposition(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除初烤烟近红外化学成分检测编号为"' + ids + '"的数据项？').then(function() {
        return delComposition(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('composition/composition/export', {
        ...this.queryParams
      }, `composition_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
